Week 1 Analysis
Stephanie[^1] is a student that will be starting school at BYU-Idaho next semester. Suppose she sent you the following email.
“Hi. My name is Stephanie. I would like to learn about what housing options I have for living at BYU-Idaho next semester. It will be my first semester there, so I would like to find something that is close to campus and around $300 a month in rent. I’m not too picky on roomates, but I would like somewhere that has a lot of people around so I can get to know as many people as possible. Thanks in advance!”
Write your response to Stephanie below. Use the “Rent” dataset, good statistical analysis, and clear writing to make some well supported suggestions to her about apartments that meet her stated criterions. You are free to use other criterion that you think she might find more meaningful as well.
Dear Stephanie,
Write your response here… (delete this line).
# Code to get you started, be sure to use a subset of Rent instead of Rent in this code though.
datatable(subset(Rent,Rent$Gender=="F"), options=list(lengthMenu = c(3,10,30)), extensions="Responsive")
Stephanie is looking for an apartment complex that has a couple of criteria. First she wants something that is reasonably priced, around $300 a month, which would be around $900 per semester. This can be found based on the “Price” column in the rent dataset. Second, she wants something that is not too far from campus. Again, the dataset has relevant information in the “MilesToCampus” column, Third, she wants someplace with a lot of people. This can be answered using the “Capacity” column. We can find the median and mean and try to find an apartment complex greater than those values. To summarize, the question that is trying to be answered is, “Which apartment complexes are $900 or less per month, comparatively close to campus, and comparitively have a lot of people? The answer would help answer a common question that incoming, or even current, students may have.
library(plotly)
##
## Attaching package: 'plotly'
## The following object is masked from 'package:mosaic':
##
## do
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
RentWomens<- subset(Rent,Rent$Gender=="F" & Rent$Price < 1000)
# plot(Price ~ MilesToCampus, data = RentWomens,pch=19, col="red")
# text(Price ~ MilesToCampus, labels = Apartment,data=subset(Rent,Rent$Gender=="F" & Rent$Price < 1000),cex=.9,font=2,pos=4)
plot_ly(data=RentWomens, x= ~MilesToCampus, y= ~Price, text = ~Apartment, color = 'red') %>%
add_markers()
## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels
## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels
# layout(title = 'Womens Housing Scatterplot')
RentWomens<- subset(Rent,Rent$Gender=="F" & Rent$Price < 1000)
barplot(RentWomens$Capacity, las=1, names.arg = RentWomens$Capacity, axes = FALSE, horiz=TRUE, col = "steelblue")
The top 5 largest complexes listed in order are: Birch Plaza, Royal Crest, Aspen Village, Brooklyn Apartment, and Greenbrier South. The reason that I looked at capacity is because Stephanie mentioned she wanted a complex with “a lot of people around”. Out of these 5, Birch Plaza and Brooklyn Apartments seem both like viable options since they cost less and are relatively close to campus. To get a better idea of the distribution of capacity, I completed a 5 number summary below.
summary(RentWomens$Price)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 870.0 911.2 955.0 945.0 980.2 995.0
summary(RentWomens$MilesToCampus)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.06214 0.18641 0.24855 0.26020 0.32622 0.43496
summary(RentWomens$Capacity)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 6.00 10.75 31.00 89.19 105.00 343.00
After reviewing the data, the Birch Plaza and Brooklyn apartments seemed the most viable options. The only issue was deciding between the two to recommend. That is why I included the 5 number summaries above. First of all, the price. The price difference between Brooklyn and Birch Plaza is $110, with Brooklyn only costing $870 per semester, which would be less than the $300 per month that Stephanie is looking for. However, Brooklyn is farther from campus. It is .37 miles away, while Birch Plaza is only .06. Therefore, despite being cheaper, Brooklyn apartment is farther away than the average women’s apartment, and is getting close the maximum distance of apartment available. Finally, the capacity of Birch Plaza is larger than that of Brooklyn, it is more than double and is actually the largest womens complex availabe. Overall, I would recommned Birch Plaza since it is closer than the average apartment to campus, has a lot of people there, and would only cost around $327 per month.